' Sounds
' This program plays a note based on frequency and duration values
'   entered by the user.

CLS

PRINT "Enter frequency and duration values for the sound you want"
PRINT "to hear.  To quit, enter -999 for frequency."
PRINT

WHILE frequency% <> -999
    INPUT "Frequency (12-32767):  ", frequency%
    IF (frequency% <> -999) THEN
        INPUT "Duration (0-77):  ", duration&
        SOUND frequency%, duration&
        PRINT
    END IF
WEND